package com.fen.demo008;

import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.core.io.ClassPathResource;

/**
 * @author : lrf
 * @description :
 * @tip :
 * @date : 2019/3/21
 */
public class XmlConfigWithBeanFactory {

    public static void main(String[] args) {

        DefaultListableBeanFactory factory = new DefaultListableBeanFactory();

        XmlBeanDefinitionReader xdr = new XmlBeanDefinitionReader(factory);

        xdr.loadBeanDefinitions(new ClassPathResource("demo008/xml-bean-factory-config.xml"));

        Oracle oracle = (Oracle) factory.getBean("oracle");

        System.out.println(oracle.defineMeaningOfLife());
    }
}
